package com.wash.shoes.controller.mobile;


import com.lop.open.api.sdk.response.ECAP.EcapV1OrdersTraceQueryLopResponse;
import com.ruoyi.common.core.domain.R;
import com.wash.shoes.domain.jd.JdOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ljg
 * @since 2024-09-16
 */
@Log4j2
@Api(tags = {"移动端-物流信息"})
@RestController
@RequestMapping("/mobile-api/orderTransport")
public class OrderTransportMController {

    @Autowired
    JdOrderService jdOrderService;

    @ApiOperation("查询运单全程跟踪")
    @GetMapping("/commonGetOrderTraceV1")
    public R<Object> commonGetOrderTraceV1(String wayBillCode) {

        EcapV1OrdersTraceQueryLopResponse response = jdOrderService.getTransInfo(wayBillCode);
        if (response == null) {
            return R.fail("物流信息获取失败");
        } else {
            return R.ok(response);
        }
    }

}

